function searchName(){
    const mname = document.getElementById("search").value
    if(mname.trim().length == 0){
         alert("请输入关键字!")
        location.reload()
    }
    let str = ""
    Ajax({
        url:"http://localhost/project/server/movieNameSearch.php",
        data:{mname},
        success(msg){
            if(msg == "[]"){
                alert("未找到相关影片!")
                location.reload()
            }
            msg = JSON.parse(msg)
            details.innerHTML = ""
            msg.forEach(item => {
                str = `
                <div style="border:1px solid;text-align:center;margin:0 auto;margin-bottom:10px;width:273px"><img src=${item.img}>
                <p>类型:${item.leiX}</p>
                <p>名称:${item.mingc}</p>
                <p>主演:${item.zhuY}</p></div>

            `
            details.innerHTML += str
            });
        }
    })
}